#include <iostream>//CRectangle.cpp
#include <math.h>
#include "CRectangle.h"

using namespace std;

CPoint::CPoint(double a,double b)
{
    x = a;
    y = b;
}

CRectangle::CRectangle(const CPoint& lb,const CPoint& rt):left_bottom(lb),right_top(rt)
{}

void CRectangle::SetLPoint(const CPoint& left)
{
    left_bottom = left;
}

void CRectangle::SetRPoint(const CPoint& right)
{
    right_top = right;
}

double CRectangle::GetPerimeter()
{
    return 2*fabs(left_bottom.x-right_top.x)+2*fabs(left_bottom.y-right_top.y);
}

double CRectangle::GetArea()
{
    return fabs(left_bottom.x-right_top.x)*fabs(left_bottom.y-right_top.y);
}
